import request from '@/config/axios'

export interface OrderVO {
  id: number
  code: string
  orderCode: string
  status: string
  remark: string
  version: number
}

// 查询订单分页
export const pageQuery = async (params) => {
  return await request.get({ url: `/meijia/order/pageQuery`, params })
}
export const getOrderByCode = async (orderCode) => {
  return await request.get({ url: `/meijia/order/get-by-code?orderCode=`+ orderCode})
}

// 获取到家订单分页
export const getHomePageByUser = async (params) => {
  return await request.get({ url: `/meijia/home-order/get-page-by-user`, params })
}
// 获取门店订单分页
export const getStorePageByUser = async (params) => {
  return await request.get({ url: `/meijia/store-order/get-page-by-user`, params })
}

// 获取到家订单详情
export const getHomeOrderByCode = async (orderCode:string) => {
  return await request.get({ url: `/meijia/home-order/getByCode?orderCode=`+orderCode })
}

// 获取到店订单详情
export const getStoreOrderByCode = async (orderCode:string) => {
  return await request.get({ url: `/meijia/store-order/getByCode?orderCode=`+orderCode })
}

// 获得首页订单统计
export const getHomePageStatistics = async () => {
  return await request.get({ url: `/meijia/order/get-home-page-statistics` })
}
// 获得首页订单分组统计
export const getHomePageOrderGroupVO = async () => {
  return await request.get({ url: `/meijia/order/get-home-page-order-group` })
}

// 获得首页订单分组统计
export const getHomePageOrderMonthGroupVO = async () => {
  return await request.get({ url: `/meijia/order/get-home-page-month-order-group` })
}